package com.my.swas.sso.module.api.controller;

import com.my.swas.common.base.ResponseResult;
import com.my.swas.common.utils.BeanCopierUtil;
import com.my.swas.sso.common.base.BaseController;
import com.my.swas.sso.module.admin.entity.User;
import com.my.swas.sso.module.api.vo.UserInfoVo;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @author: :MaYong
 */
@Api(value = "用户管理",tags = "用户管理")
@RestController
@RequestMapping("api/user")
@ResponseBody
public class UserApiController extends BaseController{

    @GetMapping("info")
    public ResponseResult getUserInfo(){
        User user = getUser();
        UserInfoVo userInfoVo = new UserInfoVo();
        BeanCopierUtil.convert(user,userInfoVo);
        return ResponseResult.ok(userInfoVo);
    }
}
